package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "道具")
public class GDProp {

    @NoteClass(value = "道具-模板ID")
    public static class TID {
        @NoteField("进阶石")
        public static final int GRADE_STONE = 206009;

        @NoteField("代币")
        public static final int TOKEN_MONEY = 88888888;
    }

    @NoteClass(value = "道具-小类型")
    public static class Type {
        @NoteField("固定礼包")
        public static final int PACK_FIX = 3;

        @NoteField("随机礼包")
        public static final int PACK_RANDOM = 4;

        @NoteField("自选礼包")
        public static final int PACK_CHOOSE = 5;

        @NoteField(value = "饰品激活道具", detail = "个人空间里的各类道具 头像 头像框等")
        public static final int DECORATION_ACTIVE_ITEM = 6;

        @NoteField(value = "挂机资源袋", detail = "根据配置时间获取冒险关卡的挂机资源")
        public static final int HANG_BAG = 10;

        @NoteField(value = "升星道具", detail = "代替狗粮的道具")
        public static final int STAR_UP = 11;

        @NoteField("消耗道具礼包")
        public static final int PACK_COST_ITEM = 15;

        @NoteField("不确定数量的礼包")
        public static final int PACK_UNCERTAIN_NUMS = 16;

        @NoteField("道具碎片")
        public static final int PROP_PART = 17;

        @NoteField("限时兑换活动-挂机掉落物品")
        public static final int HANG_DROP_ACTIVITY_MATERIALS = 23;

        @NoteField("连开礼包")
        public static final int CONTINUE_PACK = 25;

        @NoteField("鲁比的宝贝")
        public static final int LUBI_ITEM = 26;
    }

    @NoteClass("道具-挂机资源袋-小类型")
    public static class HangType {
        @NoteField("金币")
        public static final byte GOLD = 1;

        @NoteField("英雄经验")
        public static final byte HERO_EXP = 2;

        @NoteField("进阶石")
        public static final byte STONE = 3;

        @NoteField("金币+经验+进阶石")
        public static final byte ALL = 4;
    }

    @NoteClass("道具-品质")
    public static class Quality {

        @NoteField("普通")
        public static final byte Q0 = 0;

        @NoteField("精良")
        public static final byte Q1 = 1;

        @NoteField("稀有")
        public static final byte Q2 = 2;

        @NoteField("史诗")
        public static final byte Q3 = 3;

        @NoteField("传说")
        public static final byte Q4 = 4;

        @NoteField("神话")
        public static final byte Q5 = 5;

        @NoteField("永恒")
        public static final byte Q6 = 6;

        public static String getDesc(byte quality) {
            if (quality == Q0) {
                return "普通";
            } else if (quality == Q1) {
                return "精良";
            } else if (quality == Q2) {
                return "稀有";
            } else if (quality == Q3) {
                return "史诗";
            } else if (quality == Q4) {
                return "传说";
            } else if (quality == Q5) {
                return "神话";
            } else if (quality == Q6) {
                return "永恒";
            }
            return "";
        }
    }

    @NoteClass("道具-品质文本颜色")
    public static class Colour {

        @NoteField("品质灰")
        public static String C0;

        @NoteField("品质绿")
        public static String C1;

        @NoteField("品质蓝")
        public static String C2;

        @NoteField("品质紫")
        public static String C3;

        @NoteField("品质橙")
        public static String C4;

        @NoteField("品质红")
        public static String C5;

        public static String getColourByQuality(byte quality) {
            switch (quality) {
                case Quality.Q0:
                    return C0;
                case Quality.Q1:
                    return C1;
                case Quality.Q2:
                    return C2;
                case Quality.Q3:
                    return C3;
                case Quality.Q4:
                    return C4;
                case Quality.Q5:
                    return C5;
                default:
                    return C5;
            }
        }

        public static String getColorStrByQuality(byte quality) {
            switch (quality) {
                case Quality.Q0:
                    return "白色";
                case Quality.Q1:
                    return "绿色";
                case Quality.Q2:
                    return "蓝色";
                case Quality.Q3:
                    return "紫色";
                case Quality.Q4:
                    return "橙色";
                case Quality.Q5:
                    return "红色";
                case Quality.Q6:
                    return "彩色";
                default:
                    return "";
            }
        }
    }

    public static void initialize(ParamSheet paramSheet){
        Colour.C0 = GDParamTool.getString(paramSheet,102,"#2d2d2d");
        Colour.C1 = GDParamTool.getString(paramSheet,103,"#59a168");
        Colour.C2 = GDParamTool.getString(paramSheet,104,"#5879bc");
        Colour.C3 = GDParamTool.getString(paramSheet,105,"#a25fc5");
        Colour.C4 = GDParamTool.getString(paramSheet,106,"#d3935f");
        Colour.C5 = GDParamTool.getString(paramSheet,107,"#bd5963");
    }
}
